<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>test</title>
    <script src="https://a.alipayobjects.com/seajs/seajs/2.2.0/sea.js"></script>
    <script>
    seajs.config({
      alias: {
        $: 'jquery/jquery/1.7.2/jquery'
      }
    });
    </script>
  </head>
  <body>
    <script>
    seajs.use(['../index.js'], function(Messenger) {
        var messenger = new Messenger('iframe1', 'tests');
        messenger.addTarget(window.parent, 'parent');
        messenger.listen(function(msg) {
            parent.seajs.parentMessage = msg;
        });
        messenger.send('from iframe.');
        parent.window.loaded.call(parent);
    });
    </script>

  </body>
</html>

